<template>
    <view>
        <!-- Map -->
        <view class="map">
            <web-view :src="dataInfo"></web-view>
        </view>
    </view>
</template>
<script>
    import { getToken } from "@/utils/auth";
    import config from '@/config'
    export default {
        data() {
            return {
                dataInfo: "/hybrid/html/mapdetail.html",
                tokenInfo: "",
                szwz: "",
                baseUrl: config.baseUrl
            };
        },
        onLoad(option) {
            const _this = this;
            this.szwz = option.szwz;
            let wzArr = this.szwz.split(',')
            var util = require('@/utils/WSCoordinate.js')
            var result = util.transformFromGCJToBaidu(wzArr[0], wzArr[1]);

            this.tokenInfo = getToken();
            _this.dataInfo +=
                "?token=" +
                encodeURIComponent(_this.tokenInfo) +
                "&baseUrl=" +
                encodeURIComponent(_this.baseUrl) +
                "&szwz=" +
                encodeURIComponent(_this.szwz);
        },
        onReady() {
            // #ifdef APP-PLUS
            var currentWebview = this.$scope.$getAppWebview().children()[0];
            currentWebview.addEventListener("loaded", function () {
                currentWebview.evalJS("mui.init({keyEventBind: {backbutton: false }});");
            });
            // #endif
        },
        methods: {

        },
    };
</script>